#ifndef LOG_COUNTDOWNLATCH_H
#define LOG_COUNTDOWNLATCH_H

#include <mutex>
#include <condition_variable>

namespace DBServer
{
namespace Log
{

class CountDownLatch {
public:

    explicit CountDownLatch(int count);

    void wait();

    void count_down();

    int get_count();

private:
    std::mutex mutex_;
    std::condition_variable condition_;
    int count_;
};
} // namespace Log
} // namespace DBServer



#endif